package com.gxa.modules.service.impl;

import com.gxa.common.exception.ManageException;
import com.gxa.common.utils.RandomUtils;
import com.gxa.modules.mapper.UserMapper;
import com.gxa.modules.pojo.R_Role;
import com.gxa.modules.pojo.R_User;
import com.gxa.modules.service.UserService;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import springfox.documentation.annotations.Cacheable;

import java.util.List;

/**
 * @Author: wangyifan
 * @Date: 2021/12/29 14:31
 * @Description: $end$
 * @Version: V1.0
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired(required = false)
    private UserMapper userMapper;



    @Override
    public List<R_User> findUserAll() {
        List<R_User> userList = userMapper.findUserAll();
        return userList;
    }

    @Override

    public R_User findByUserName(String userName) {
        R_User user = userMapper.findByUserName(userName);
        if(user == null){throw new ManageException("账户不存在");};
        return user;
    }


}
